package com.example.es.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "app_info_article")
public class SearchArticleVo {
    // 文章id
    @Id
    @Field(type = FieldType.Long)
    private Long articleId;
    // 文章标题
    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String articleTitle;
    // 文章发布时间
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private Date publishTime;
    //  文章布局
    @Field(type = FieldType.Integer)
    private Integer articleLayout;
    // 封面
    @Field(type = FieldType.Keyword, index = false)
    private String articleImages;
    //  作者id
    @Field(type = FieldType.Long)
    private Long authorId;
    // 作者名词
    @Field(type = FieldType.Text)
    private String authorName;
    // 静态url
    @Field(type = FieldType.Keyword, index = false)
    private String staticUrl;
    // 文章内容
    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String articleContent;
}